/***********************************************************************
    filename:   CEGUIFontManager.h
    created:    Sun Jul 19 2009
    author:     Paul D Turner <paul@cegui.org.uk>
*************************************************************************/

#ifndef _HgeFontManager_h_
#define _HgeFontManager_h_

#include "hgeSingleton.h"
#include "hgeFont.h"
#include "hgeIteratorBase.h"

#if defined(_MSC_VER)
#   pragma warning(push)
#   pragma warning(disable : 4275)
#   pragma warning(disable : 4251)
#endif

/*!
\brief
    Class providing a shared library of Font objects to the system.

    The FontManager is used to create, access, and destroy Font objects.  The
    idea is that the FontManager will function as a central repository for Font
    objects used within the GUI system, and that those Font objects can be
    accessed, via a unique name, by any interested party within the system.
*/
class FontManager : public Singleton<FontManager>       
{
public:
    //! Constructor.
    FontManager();

    //! Destructor.
    ~FontManager();

	//--------------- Font -----------------
	//! ConstBaseIterator type definition.
	typedef std::map<String, hgeFont*> FontRegistry;
	typedef ConstBaseIterator<FontRegistry> FontIterator;    
	FontIterator getFontIterator() const;

    //Creates a FreeType type font.    
    hgeFont& createFont(const String& font_name, const String& font_filename, const float point_size,
                             const bool anti_aliased);
	hgeFont& getFont(const String& font_name) const;	
	void destroyFont(FontRegistry::iterator ob);

	//Notify the FontManager that display size may have changed.
	void		notifyDisplaySizeChanged(const Size& size);

private:
	FontRegistry d_fonts;
};


#if defined(_MSC_VER)
#	pragma warning(pop)
#endif

#endif	// end of guard _HgeFontManager_h_
